<script src="http://img.kekenet.com/statics/js/jquery.min.js"></script>

<form id="frm_box" action="" method="POST" enctype="multipart/form-data">
<div>栏目
<select name="catid">
{{foreach from=$sub_cats item=c1}}
	<option value="{{$c1['catid']}}" {{if $catid == $c1['catid']}}selected="selected"{{/if}} >{{$c1['catname']}}</option>
	{{foreach from=$c1['child'] item=c2}}
		<option value="{{$c2['catid']}}" {{if $catid == $c2['catid']}}selected="selected"{{/if}}>->{{$c2['catname']}}</option>
		{{foreach from=$c2['child'] item=c3}}
			<option value="{{$c3['catid']}}" {{if $catid == $c3['catid']}}selected="selected"{{/if}}>->->{{$c3['catname']}}</option>
		{{/foreach}}
	{{/foreach}}
{{/foreach}}
</select>

</div>
<div>标题<input name="title" value="{{$title|default:''}}" /></div>
<div>来源
  <input name="copyurl" value="" />
  <input name="copyname" value="" />
  <select name="copyfrom" >
    <option value="" selected="selected">≡请选择≡</option>
    {{foreach from=$cf_list item=cf}}
    <option value="<a href='{{$cf['siteurl']}}' target='_blank'>{{$cf['sitename']}}</a>" {{if $copyfrom == "<a href='{{$cf['siteurl']}}' target='_blank'>{{$cf['sitename']}}</a>"}}selected="selected"{{/if}}>{{$cf['sitename']}}</option>
    {{/foreach}}
  </select>

</div>
<div>音频<input type="text" name="file_url" value="{{$file_url|default:''}}" /></div>
<div>作者<input type="text" name="author" value="{{$now_name}}" /></div>
<div>缩略图<input type="file" name="thumb" /></div>
<div>关键字<input type="text" name="keywords" value="{{$keywords|default:''}}"/></div>
<div>摘要<textarea name="description">{{$description|default:''}}</textarea></div>
<div>内容<textarea name="content">{{$content|default:''}}</textarea></div>
<div>发布时间<input type="text" name="inputtime" value="{{$now_time}}" /></div>
<div>习题<textarea name="kkq_q">{{$question|default:''}}</textarea></div>
<div>习题答案<textarea name="kkq_a">{{$answer|default:''}}</textarea></div>
<input type="hidden" name="id" value="{{$id|default:'0'}}" />
<input type="hidden" name="url" value="{{$url|default:''}}" />
{{if $id != 0}}
<input type="submit" value="提交并生成" />
<input type="button" value="另存为新文章" id="do_new"/>
<script>
$('#do_new').click(function(){
	$('#frm_box').attr('action', 'detail.add?pid={{$pid}}').submit();
});
</script>
{{else}}
<input type="submit" value="提交并生成" />
{{/if}}
</form>